﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Data;
using System.Web.Profile;
using System.Web.UI.WebControls;

namespace WebSite.cn
{
    public partial class products_detfrm1 : System.Web.UI.Page
    {
        // Fields
        public string proinfo = "";

        // Methods
        private void Bind()
        {
            int num = 0;
            DataTable table = SQLAccess.GreatDs("select DB_Proxian.proids,DB_Shoppro.proname,DB_Shoppro.proprice1,DB_Shoppro.typeid,DB_Shoppro.propic2 from DB_Proxian inner join DB_Shoppro on DB_Shoppro.proid=DB_Proxian.proids where DB_Proxian.proid=" + base.Request.QueryString["pid"].ToString() + " ").Tables[0];
            if (table.Rows.Count > 0)
            {
                foreach (DataRow row in table.Rows)
                {
                    this.proinfo = this.proinfo + "<td><table width='160' height='160' border='0' cellpadding='5' cellspacing='0' class='border_02'>";
                    this.proinfo = this.proinfo + "<tr><td align='center'>";
                    string proinfo = this.proinfo;
                    this.proinfo = proinfo + "<a href=products_details.aspx?typeid=" + row["typeid"].ToString() + "&pid=" + row["proids"].ToString() + " target='_parent'><img src='../uploadfile/product/" + row["propic2"].ToString() + "'</a>";
                    this.proinfo = this.proinfo + "</td></tr>";
                    string str3 = this.proinfo;
                    this.proinfo = str3 + " <tr><td><a href=products_details.aspx?typeid=" + row["typeid"].ToString() + "&pid=" + row["proids"].ToString() + " target='_parent'>" + row["proname"].ToString() + "</a></td></tr>";
                    this.proinfo = this.proinfo + "<tr><td>￥" + row["proprice1"].ToString() + "</td></tr>";
                    this.proinfo = this.proinfo + "</table></td>";
                    num++;
                    if ((num % 4) == 0)
                    {
                        this.proinfo = this.proinfo + "</tr><tr><td colspan=4 height=5></td></tr><tr>";
                    }
                }
            }
            else
            {
                this.proinfo = "无相关产品!";
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack && (base.Request.QueryString["pid"] != null))
            {
                this.Bind();
            }
        }

    }
}